package com.action.app_matter;

import java.io.PrintWriter;
import java.io.Serializable;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.json.JSONArray;
import org.json.JSONObject;

import com.dataProcess.Matter;
import com.enetiy.Area;
import com.enetiy.Balance;
import com.enetiy.Balanceorder;
import com.enetiy.Comboinfo;
import com.enetiy.Comborecord;
import com.enetiy.Mapspoor;
import com.enetiy.Ticket;
import com.enetiy.Ticketuser;
import com.enetiy.Transaction;
import com.enetiy.Users;
import com.enetiy.Vipmember;
import com.enetiy.Viprecord;
import com.service.ComboService;
import com.service.DealService;
import com.service.LoginService;
import com.service.MapService;
import com.service.TicketService;
import com.util.DataUtil;
import com.util.DateUtil;
import com.util.Log4gUtil;
import com.util.PagingUilt;

public class DealAction {
	private DealService dealService;
	private TicketService ticketService;
	private LoginService loginService;
	private MapService mapService;
	private ComboService comboService;
	
	private String params;
	private String NF_callid;
	private String token;
	private String  buytime;
	private String endtime; 
	
	private String  balance;//金额
	private int vipnum;//vip编号
	private String fees;//使用计费
	private int pledge;//保证金
	private String orderFrom;//订单
	private int userid;
	private int time ;
	private String speed;
	private String price;
	private int wayid;
	private int combonum; 
	private int timeLong;
	private Double money;
	private int time_unit;
	private int areaid;
	
	private int pageNum;
	private int pageSize;
	private PagingUilt<Transaction> pu ;
	
	/**
	 * 时长查询  >Nf030
	 */
	public void selectBalance(){
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
		}
		Log4gUtil.Info("selectBalance-余额查询:", userid+"", "params", params, NF_callid, token);
	
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		try {
			out = response.getWriter();
			Users user = loginService.selectUserId(userid);
			if(user!=null){
				Balance bal = dealService.selectBalance(userid);
				List<Ticketuser> selectTicketuserList = ticketService.selectTicketuserList(userid, 0);
				if(bal==null){
					bal = new Balance(user, "0", new Date(), 0,0);
					dealService.insertBalance(bal);
				}
				//未领取券数量
				if(!selectTicketuserList.isEmpty()){
					send.put("ticketNum", selectTicketuserList.size());
				}else{
					send.put("ticketNum", 0);
				}
				//总时长
				int longTime = bal.getLongTime();
				if(bal.getTicket04()!=null){
					longTime=bal.getTicket04()+longTime;
				}
				send.put("code", 1);
				send.put("longTime", longTime);
				
			}else{
				send.put("code", 0);
				send.put("msg", "用户不存在");
			}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		out.print(send);
		Log4gUtil.Info("selectBalance-余额查询:", userid+"", "结果", send.toString(), NF_callid, token);
	}
	
	/**
	 * 时长充值  >Nf031
	 */
	public void saveBalance(){
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
			if(dataParser.has("balance"))//充值金额
				balance= dataParser.getString("balance");
			if(dataParser.has("price"))//价格
				price= dataParser.getString("price");
			if(dataParser.has("orderid"))//订单号
				orderFrom = dataParser.getString("orderid");
			if(dataParser.has("wayid"))
				wayid= dataParser.getInt("wayid");
			if(dataParser.has("areaid"))
				areaid= dataParser.getInt("areaid");
		}
		Log4gUtil.Info("saveBalance-余额充值", userid+"", "params", params, NF_callid, token);
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		try {
			out = response.getWriter();
			//查询用户
			Users user = loginService.selectUserId(userid);
			if(user!=null){
				Balanceorder order = dealService.selectBalanceorder(userid, orderFrom);
				if(orderFrom!=null&&!orderFrom.equals("")&&order==null){
					Balance bal = dealService.selectBalance(userid);
						//计算时长
						int longTime = (int) ((Double.parseDouble(balance)/Double.parseDouble(price))*60);
						
						//充多少送多少 券
						Ticket ticket = ticketService.selectTicket("ticket-05");
						if(ticket!=null){
								Ticketuser t = new Ticketuser(user, ticket, new Date(), null, 0,longTime);
								ticketService.insertTickeUser(t);
						}
						
						if(bal==null){//如用户 无 时长包 则创建
							bal = new Balance();
							bal.setPayNum(1);
							bal.setLongTime(longTime);
							//总充值额
							bal.setAmount(Double.parseDouble(balance)+"");
							bal.setUpdateTime(new Date());
							bal.setUsers(user);
							bal.setTicket04(0);
							dealService.insertBalance(bal);
							
						}else{//如用户 有 时长包 则修改
							//总充值额
							DecimalFormat df = new DecimalFormat("#.00");
							String amount = df.format((Double.parseDouble(bal.getAmount())+Double.parseDouble(balance)));
							bal.setAmount(amount);
							bal.setLongTime(longTime+bal.getLongTime());
							bal.setUpdateTime(new Date());
							if(bal.getPayNum()!=null){
								bal.setPayNum(bal.getPayNum()+1);
							}else{
								bal.setPayNum(1);
							}
							dealService.updateBalance(bal);
						}
						//21模式第一次充值添加用户vip
						if(wayid==21){
								Vipmember vip=new Vipmember();
								vip.setFees("0.2");
								vip.setSpeed(4);
								vip.setNameCode(6);
								vip.setUsers(user);
								vip.setWayId(wayid);
								vip.setSetTime(new Date());
								vip.setPledge(0);
								Matter ma =new Matter();
								ma.saveVip(dealService, user, vip,ticketService);
						}
						//添加交易明细
						Transaction tr = new Transaction("时长", 2, longTime , userid, new Date(), balance,areaid);
						dealService.insetrTransaction(tr);
						//添加订单号
						order = new Balanceorder(orderFrom, new Date(), 2);
						order.setUserid(userid);
						dealService.insertBalanceorder(order);
						send.put("code", 1);
						
					}else{
						send.put("code", 0);
						send.put("msg", "订单号为空或订单号已重复");
					}
				}else{
					send.put("code", 0);
					send.put("msg", "用户不是会员");
				}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		Log4gUtil.Info("saveBalance-余额充值", userid+"", "结果", send.toString(), NF_callid, token);
		out.print(send);
	}
	
	/**
	 * 
	 * 新增VIP  >Nf032
	 */
	public void saveVipmember(){
		Log4gUtil.getLog().info("saveVipmember-userid:"+userid+"-新增vip-:"+params);
		String ple = "1";
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
			if(dataParser.has("vipnum"))
				vipnum= dataParser.getInt("vipnum");//会员编号
			if(dataParser.has("pledge")&&!dataParser.getString("pledge").equals("0.01"))//保证金
				ple= dataParser.getString("pledge");
			if(dataParser.has("fees"))//计费
				fees= dataParser.getString("fees");
			if(dataParser.has("speed"))//速率
				speed= dataParser.getString("speed");
			if(dataParser.has("orderid"))//订单号
				orderFrom = dataParser.getString("orderid");
			if(dataParser.has("wayid"))
				wayid= dataParser.getInt("wayid");
			if(dataParser.has("areaid"))
				areaid= dataParser.getInt("areaid");
		}
		Log4gUtil.Info("saveVipmember-新增VIP", userid+"", "params", params, NF_callid, token);
		int spee = Integer.parseInt(speed.substring(0, 1));
		pledge=Integer.parseInt(ple);
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		try {
			out = response.getWriter();
			Users user = loginService.selectUserId(userid);
			if(user!=null){
				Balanceorder order = dealService.selectBalanceorder(userid, orderFrom);
				if(orderFrom!=null&&!orderFrom.equals("")&&order==null){
					Balance bal = dealService.selectBalance(userid);
					if(bal==null){//时长包不存在,则添加
						bal = new Balance(user, "0", new Date(), 0,0);
						dealService.insertBalance(bal);
					}
					
					Vipmember vip=new Vipmember();
					vip.setFees(fees);
					vip.setSpeed(spee);
					vip.setNameCode(vipnum);
					vip.setUsers(user);
					vip.setWayId(wayid);
					vip.setSetTime(new Date());
					vip.setPledge(pledge);
					vip.setAreaId(areaid);
					Matter ma =new Matter();
					ma.saveVip(dealService, user, vip,ticketService);
					
					send.put("code", 1);
					//添加交易明细
					Transaction tr = new Transaction("会员", 2, 0, userid, new Date(), pledge+"",areaid);
					dealService.insetrTransaction(tr);
					//添加订单号
					order = new Balanceorder(orderFrom, new Date(), 4);
					order.setUserid(userid);
					dealService.insertBalanceorder(order);
					
				}else{
					send.put("code", 0);
					send.put("msg", "订单号已存在");
				}
			}else{
				send.put("code", 0);
				send.put("msg", "用户不存在");
			}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		Log4gUtil.Info("saveVipmember-新增VIP", userid+"", "结果", send.toString(), NF_callid, token);
		out.print(send);
	}
	
	/**
	 * 解除VIP  >Nf034
	 */
	public void delVipmember(){
		Log4gUtil.getLog().info("delVipmember-userid:"+userid+"-删除VIP-:"+params);
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
			if(dataParser.has("vipnum"))
				vipnum= dataParser.getInt("vipnum");
			if(dataParser.has("orderid"))//订单号
				orderFrom = dataParser.getString("orderid");
			
		}
		Log4gUtil.Info("delVipmember-删除VIP", userid+"","params", params, NF_callid, token);
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		try {
			out = response.getWriter();
			Users user = loginService.selectUserId(userid);
			Balanceorder order = dealService.selectBalanceorder(userid,orderFrom);
			if(orderFrom!=null&&!orderFrom.equals("")&&order==null){
				if(user!=null){
					Vipmember vip = dealService.selVipmember(userid,vipnum);
					if(vip!=null){
						dealService.deleteVipmember(vip);
						
						Balance bal = dealService.selectBalance(userid);
						bal.setTicket04(0);
						dealService.updateBalance(bal);
						
						//新增vip记录
						Viprecord v= new Viprecord(vip.getUsers().getId(),vip.getNameCode(),(double)vip.getPledge(),new Date(),vip.getWayId(),"退还",vip.getAreaId());
						dealService.insetrViprecord(v);
						//添加交易明细
						Transaction tr = new Transaction("会员", 3, 0, userid, new Date(), vip.getPledge()+"",vip.getAreaId());
						dealService.insetrTransaction(tr);
						//添加订单号
						order = new Balanceorder(orderFrom, new Date(), 4);
						order.setUserid(userid);
						dealService.insertBalanceorder(order);
					}
					send.put("code", 1);
				}else{
					send.put("code", 0);
					send.put("msg", "用户不存在");
				}
			}else{
				send.put("code", 0);
				send.put("msg", "订单号已存在");
			}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		Log4gUtil.Info("delVipmember-删除VIP", userid+"","结果", send.toString(), NF_callid, token);
		out.print(send);
	}
	
	/**
	 * 
	 * 查询VIP >Nf033
	 */
	public void selectVipmember(){
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
		}
		
		Log4gUtil.Info("selectVipmember-查询VIP", userid+"", "params", params, NF_callid, token);
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		try {
			out = response.getWriter();
			Users user = loginService.selectUserId(userid);
			if(user!=null){
				List<Vipmember> vip = dealService.selectVipmember(userid);
				if(vip!=null&&!vip.isEmpty()){
					send.put("code", 1);
					int pledge = 0;
					int vipnum = 0;
					for (int i = 0; i < vip.size(); i++) {
						pledge=vip.get(i).getPledge();
						vipnum=vip.get(i).getNameCode();
						if(vip.get(i).getPledge()!=0){
							break;
						}
					}
					send.put("pledge", pledge );
					send.put("vipnum", vipnum );
				}else{
					send.put("code", 0);
					send.put("msg", "用户不是vip");
				}
			}else{
				send.put("code", 0);
				send.put("msg", "用户不存在");
			}
			
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		Log4gUtil.Info("selectVipmember-查询VIP", userid+"", "输出", send.toString(), NF_callid, token);
		out.print(send);
	}
	
	private void verify(String params){
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
		}
	}
	
	
	/**
	 * 
	 * 用户套餐
	 */
	public void selCombo(){
		verify(params);
		Log4gUtil.Info("selCombo-查询combo", userid+"", "params", params, NF_callid, token);
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		try {
			out = response.getWriter();
			Users user = loginService.selectUserId(userid);
			if(user!=null){
				List<Comboinfo> comboList = comboService.selectUserComboList(userid);
				JSONArray js = new JSONArray(comboList);
				send.put("code", 1);
				send.put("comboList", js.toString());
			}else{
				send.put("code", 0);
				send.put("msg", "用户不存在");
			}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		out.print(send);
	}
	
	/**
	 * 
	 * 新增用户套餐
	 */
	
	public void saveCombo(){
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
			if(dataParser.has("combonum"))
				combonum= dataParser.getInt("combonum");
			if(dataParser.has("wayid"))
				wayid= dataParser.getInt("wayid");
			if(dataParser.has("speed"))//速率
				speed= dataParser.getString("speed");
			if(dataParser.has("timeLong"))
				timeLong = dataParser.getInt("timeLong");
			if(dataParser.has("time_unit"))
				time_unit = dataParser.getInt("time_unit");
			if(dataParser.has("orderid"))//订单
				orderFrom= dataParser.getString("orderid");
			if(dataParser.has("money"))//金额
				money= dataParser.getDouble("money");
			if(dataParser.has("areaid"))
				areaid= dataParser.getInt("areaid");
		}
		Log4gUtil.Info("saveCombo-新增combo", userid+"", "params", params, NF_callid, token);
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		
		try {
			//速率
			int spee = Integer.parseInt(speed.substring(0, 1));
			//结束时间点
			if(time_unit==4)
				time_unit = 5;
			Date endTime = null;
			
			SimpleDateFormat sf  =new SimpleDateFormat("yyyy-MM-dd");
			out = response.getWriter();
			Users user = loginService.selectUserId(userid);
			Area area = new Area();
			area.setId(areaid);
			Date date = new Date();
			if(user!=null){
				Balanceorder order = dealService.selectBalanceorder(userid, orderFrom);
				if(orderFrom!=null&&!orderFrom.equals("")&&order==null){
					Comboinfo combo = comboService.selCombo(userid, combonum);
					if(combo==null){
						endTime = DateUtil.getDate(date, time_unit, timeLong);
						combo=new Comboinfo();
						combo.setUsers(user);
						combo.setWayId(wayid);
						combo.setArea(area);
						combo.setTimeLong(timeLong);
						combo.setComboid(combonum);
						combo.setMoney(money);
						combo.setComboUnit(time_unit);
						combo.setDescr("");
						combo.setStatus(1);
						combo.setBandwidth(spee);
						 
						 if(endtime!=null){
								Date parse = sf.parse(endtime);
								combo.setEndTime(parse);
							}else{
								combo.setEndTime(endTime);
							}
						if(buytime!=null){
							Date parse = sf.parse(buytime);
							combo.setBuyTime(parse);
						}else{
							combo.setBuyTime(date);
						}
						comboService.insertUserCombo(combo);
					}else{
						long time1 = combo.getEndTime().getTime();
						long time2 = date.getTime();
						if(time1>time2){
							endTime = DateUtil.getDate(combo.getEndTime(), time_unit, timeLong);
						}else{
							endTime = DateUtil.getDate(date, time_unit, timeLong);
						}
						combo.setUsers(user);
						combo.setWayId(wayid);
						combo.setTimeLong(combo.getTimeLong()+timeLong);
						combo.setComboid(combonum);
						combo.setMoney(combo.getMoney()+money);
						combo.setComboUnit(time_unit);
						combo.setArea(area);
						if(endtime!=null){
							Date parse = sf.parse(endtime);
							combo.setEndTime(parse);
						}else{
							combo.setEndTime(endTime);
						}
						combo.setDescr("");
						combo.setStatus(1);
						combo.setBandwidth(spee);
						comboService.updateUserCombo(combo);
					}
					send.put("code", 1);
					
					//添加combo记录
					
					Comborecord comborecord = new Comborecord( areaid, combo.getUsers().getId(), date, 
							 combo.getDescr(), combo.getStatus(), combo.getComboid(), combo.getComboName(),  combo.getBandwidth(),
							 money, combo.getWayId(), time_unit,timeLong,combo.getEndTime());
							
					comboService.insertUserComboRecord(comborecord);
					
					//添加交易明细
					Transaction tr = new Transaction("套餐", 1, 0, userid, date, pledge+"",areaid);
					dealService.insetrTransaction(tr);
					
					//添加订单号
					order = new Balanceorder(orderFrom, date, 4);
					order.setUserid(userid);
					dealService.insertBalanceorder(order);
				}else{
					send.put("code", 0);
					send.put("msg", "订单号已存在");
				}
			}else{
				send.put("code", 0);
				send.put("msg", "用户不存在");
			}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		out.print(send);
		Log4gUtil.Info("saveCombo-新增combo", userid+"", "输出", send.toString(), NF_callid, token);
	}
	
	
	
	/**
	 * 消费时长   >Nf035
	 */
	public void feeBalance(){
		JSONObject data = DataUtil.dataParser(params);
		JSONArray jsons=null;
		if(params!=null&&!params.equals("")){
			if(data.has("list"))
				jsons =	data.getJSONArray("list");
		}
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		try {
			
			out = response.getWriter();
			if(jsons!=null&&jsons.length()>0){
				for (int i = 0; i < jsons.length(); i++) {
					int mac_type =0;
					int server_type =0;
					int protectid = 0;
					String orderid ="";
					JSONObject json= (JSONObject) jsons.get(i);
					if(json.has("userid"))
						userid=json.getInt("userid");
					if(json.has("usertime"))
						time = json.getInt("usertime");
					if(json.has("mac_type"))
						mac_type =json.getInt("mac_type");
					if(json.has("server_type"))
						server_type =json.getInt("server_type");
					if(json.has("protectid"))
						protectid = json.getInt("protectid");
					if(json.has("orderid"))
						orderid = json.getString("orderid");
					Users user = loginService.selectUserId(userid);
					if(user!=null){
						Matter matter = new Matter();
						matter.feeYue(dealService,mapService, userid, time,NF_callid,token,server_type,mac_type,protectid,orderid);
						send.put("code", 1);
					}else{
						send.put("code", 0);
						send.put("msg", "用户不存在");
					}
				}
			}else{
				send.put("code", 0);
				send.put("msg", "无数据");
			}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		out.print(send);
	}
	
	
	
	/**
	 * 
	 * 交易明细查询   >Nf036
	 */
	public void selectTransaction(){
		if(params!=null&&!params.equals("")){
			JSONObject dataParser = DataUtil.dataParser(params);
			if(dataParser.has("userid"))
				userid= dataParser.getInt("userid");
			if(dataParser.has("pageNum"))
				pageNum= dataParser.getInt("pageNum");
			if(dataParser.has("pageSize"))
				pageSize= dataParser.getInt("pageSize");
			
		}
		JSONArray al =new JSONArray();
		HttpServletResponse response = ServletActionContext.getResponse();
		net.sf.json.JSONObject send =DataUtil.sendJson();
		PrintWriter out = null;
		
		pu  = new PagingUilt<Transaction>();
		if(pageNum!=0&&pageSize!=0){
			pu.setPageNum(pageNum);
			pu.setPageSize(pageSize);
		}
		try {
			out = response.getWriter();
			Users user = loginService.selectUserId(userid);
			if(user!=null){
				 dealService.selectTransaction(pu, userid);
				if(!pu.getList().isEmpty()){
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
					send.put("code", 1);
					for (int i = 0; i < pu.getList().size(); i++) {
						Transaction transaction = pu.getList().get(i);
						JSONObject jo = new JSONObject();
						jo.put("longTime", transaction.getLongTime());//消费时间
						String format = sdf.format(transaction.getSpendTime());
						jo.put("spendTime",format );//时间
						jo.put("use", transaction.getUse());//作用(1:消费; 2:充值;3:退款)
						jo.put("spendCost",  transaction.getSpendCost());//花费
						jo.put("type",transaction.getType());//交易用途(套餐;会员)
						al.put(jo);
					}
					send.put("list", al.toString());//消费时间
					send.put("pageCount", pu.getPageCount());
				}else{
					send.put("code", 0);
					send.put("msg", "用户无交易");
				}
			}else{
				send.put("code", 0);
				send.put("msg", "用户不存在");
			}
		} catch (Exception e) {
			send.put("code", -1);
			send.put("msg", "服务器异常");
			e.printStackTrace();
		}
		out.print(send);
		Log4gUtil.Info("selectTransaction-交易", userid+"", "输出", send.toString(), NF_callid, token);
	}
	
	
	
	
	public void setDealService(DealService dealService) {
		this.dealService = dealService; 
	}

	public void setToken(String token) {
		this.token = token;
	}

	public void setLoginService(LoginService loginService) {
		this.loginService = loginService;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public void setUserid(int userid) {
		this.userid = userid;
	}

	public void setBalance(String balance) {
		this.balance = balance;
	}

	public void setVipnum(int vipnum) {
		this.vipnum = vipnum;
	}

	public void setNF_callid(String nF_callid) {
		NF_callid = nF_callid;
	}

	public void setFees(String fees) {
		this.fees = fees;
	}

	public void setPledge(int pledge) {
		this.pledge = pledge;
	}

	public void setOrderFrom(String orderFrom) {
		this.orderFrom = orderFrom;
	}

	public void setTime(int time) {
		this.time = time;
	}

	public void setTicketService(TicketService ticketService) {
		this.ticketService = ticketService;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public void setSpeed(String speed) {
		this.speed = speed;
	}

	public void setMapService(MapService mapService) {
		this.mapService = mapService;
	}

	public void setComboService(ComboService comboService) {
		this.comboService = comboService;
	}

	public void setWayid(int wayid) {
		this.wayid = wayid;
	}

	public void setCombonum(int combonum) {
		this.combonum = combonum;
	}

	public void setTimeLong(int timeLong) {
		this.timeLong = timeLong;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public void setTime_unit(int time_unit) {
		this.time_unit = time_unit;
	}

	public void setBuytime(String buytime) {
		this.buytime = buytime;
	}

	public void setEndtime(String endtime) {
		this.endtime = endtime;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public void setPu(PagingUilt<Transaction> pu) {
		this.pu = pu;
	}
	
}
